home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 1
/
Cream of the Crop 1.iso
/
PROGRAM
/
VS_804.ARJ
/
MAINTSRC.EXE
/
_NTXTHEM.PRG
< prev
next >
Wrap
Text File
|
1991-06-20
|
3KB
|
131 lines
* Filename......: _NtxThem.Prg
*
* Author........: Vernon E. Six, Jr.
*
* Last Update...: Tue 06-18-1991 09:56:39
*
* Notice........: Copyright (c) 1991 by Vernon E. Six, Jr.
* All Rights Reserved World Wide
FUNCTION NTX_THEM
*****
* Re-Index the databases
*****
PRIVATE ac_DbfList[100]
PRIVATE ac_Msg[3]
PRIVATE n_Cntr
PRIVATE n_Dbfs
GRABSCRN()
BEGIN SEQUENCE
PALETTE(1)
NewScrn()
PALETTE(3)
ac_msg[1] = " Indexing databases. Please wait. "
ac_msg[2] = ""
ac_msg[3] = "D O N O T T U R N C O M P U T E R O F F"
DISPMSG(ac_msg,3,"","",3)
SET CURSOR OFF
PALETTE(2)
*****
* Remove all the index files
*****
SELECT A
USE
IF .NOT. OVERLAY("DEL *.NTX",80)
GRABSCRN()
PALETTE(3)
ac_Msg[1] = "Can't delete old index files now"
ac_Msg[2] = ""
ac_Msg[3] = " Please try again later. "
DISPMSG(ac_Msg,3,"","")
INKEY(10)
PUTSCRN()
BREAK
ENDIF
SELECT A
IF .NOT. V_USE("DBF_HDR",.F.)
GRABSCRN()
PALETTE(3)
ac_Msg[1] = "Can't index databases now"
ac_Msg[2] = ""
ac_Msg[3] = " Please try again later. "
DISPMSG(ac_Msg,3,"","")
INKEY(10)
PUTSCRN()
BREAK
ENDIF
*****
* Start by re-indexing the header file
*****
IF .NOT. SHOW_NTX("DBF_HDR","DBF_NAME","C")
GRABSCRN()
PALETTE(3)
ac_Msg[1] = "Can't index databases now"
ac_Msg[2] = ""
ac_Msg[3] = " Please try again later. "
DISPMSG(ac_Msg,3,"","")
INKEY(10)
PUTSCRN()
BREAK
ENDIF
*****
* Get a list of all the DBFs
*****
SELECT DBF_HDR
GO TOP
n_Dbfs = 0
n_Cntr = 0
DO WHILE .NOT. EOF() && DBF_HDR
n_Dbfs = n_Dbfs + 1
ac_DbfList[n_Dbfs] = ALLTRIM(DBF_HDR->DBF_NAME)
SKIP
ENDDO
USE
ASORT(ac_DbfList)
*****
* Here we go...
*****
FOR n_Cntr = 1 TO n_Dbfs
*****
* OPEN_DBF() will create the NTX files
*****
IF .NOT. OPEN_DBF(ac_DbfList[n_Cntr],.F.)
GRABSCRN()
PALETTE(3)
ac_Msg[1] = " Unable to index "+ac_DbfList[n_Cntr]+".DBF "
DISPMSG(ac_Msg,1,""," Press any key to continue ")
INKEY(5)
PUTSCRN()
ENDIF
NEXT n_Cntr
END SEQUENCE
USE
INITHELP()
PUTSCRN()
RETURN(.T.)
*** EOF: NTX_THEM() *********************************************************